<?php

namespace App\Http\Requests\Review;

use App\Http\Requests\ApiRequest;
use App\Models\Products\Review;
use Illuminate\Validation\Rule;

/**
 * @property string review_type
 */
class ReviewIndexRequest extends ApiRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'review_type' => ['required', 'int', Rule::in([Review::ORDER_PRODUCT_REVIEW_HAS, Review::ORDER_PRODUCT_REVIEW_NO])]
        ];
    }
}
